package proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * Created by Administrator on 2018/6/8.
 */
public class Main {
    public static void main(String[] args) {
        Trans trans = new DoTrans();
        InvocationHandler handler = new Myproxy(trans);

        Trans trans1  = (Trans) Proxy.newProxyInstance(handler.getClass().getClassLoader(),
                trans.getClass().getInterfaces(),handler);
        trans1.run("asdasd");
    }
}
